package com.yricky.memoria.activity


import android.os.Bundle
import androidx.compose.ui.platform.ComposeView
import androidx.lifecycle.ViewModelProvider
import com.yricky.memoria.BuildConfig
import com.yricky.memoria.R
import com.yricky.memoria.ui.component.MainActivityContent
import com.yricky.memoria.ui.component.MainActivityContentViewModel
import com.yricky.memoria.utils.ws

class MainActivity : BaseActivity() {
    private val viewModel:MainActivityContentViewModel by lazy{
        ViewModelProvider(this)[MainActivityContentViewModel::class.java]
    }



    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_title_compose)
        setSupportActionBar(findViewById(R.id.tb_main))
        supportActionBar?.subtitle = "${BuildConfig.APPLICATION_ID}-${BuildConfig.BUILD_TYPE}-${BuildConfig.VERSION_CODE}"
        val composeDrawer:ComposeView = findViewById(R.id.cv_main)
        composeDrawer.setContent {
            MainActivityContent(viewModel = viewModel)
        }
        viewModel.setWorkSpaceModel(ws)
    }
}
